//- Copyright (c) 2016 Lucky Byte, Inc.
extends ../../table

block form_items
  .field.thirteen.wide
    .ui.buttons.right.floated
      button.ui.left.icon.labeled.green.button(type="button"
        onclick="window.location = '/p2/blacklist/new'") 新增黑名单
        i.icon.add

block thead
  tr
    th.center.aligned.collapsing
    th.center.aligned.collapsing 序 号
    th.center.aligned.collapsing 创建时间
    th.center.aligned.collapsing 卡 BIN 号
    th.center.aligned.collapsing 卡 种
    th.center.aligned.collapsing 卡 名
    th.center.aligned.collapsing 发卡机构代码
    th.center.aligned 发卡机构名称

block tbody
  each record, index in records
    - var td_class = record.disabled ? 'disabled' : ''
    tr
      td.center.aligned.collapsing
        if record.disabled
          i.icon.lock.orange(
            style="margin-right:0px;" data-content="该用户已被禁用")
      td.center.aligned.collapsing
        a(href="/p2/blacklist/edit/#{record.serial}")= record.serial
      td.collapsing.center.aligned(class="#{td_class}") #{record.ctime.format('YYYY-MM-DD HH:mm:ss')}
      td.collapsing.center.aligned(class="#{td_class}") #{record.bin_num}
      td.collapsing.center.aligned(class="#{td_class}")
        if record.debit_credit_flag == "1"
            | 借记卡
        else if record.debit_credit_flag == "2"
            | 贷记卡
        else if record.debit_credit_flag == "3"
            | 准贷记卡
        else
            | 预付卡
      td.collapsing.center.aligned(class="#{td_class}") #{record.card_name}
      td.collapsing.center.aligned(class="#{td_class}") #{record.issuer_code}
      td.center.aligned(class="#{td_class}") #{record.issuer_name}
